/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.pub.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.pub.entity.PubAttach;
import com.thinkgem.jeesite.modules.pub.dao.PubAttachDao;

/**
 * 单表生成Service
 * @author zmy
 * @version 2019-04-18
 */
@Service
@Transactional(readOnly = true)
public class PubAttachService extends CrudService<PubAttachDao, PubAttach> {
	
	@Autowired
	private PubAttachDao pubAttachDao;

	public PubAttach get(String id) {
		return super.get(id);
	}
	
	public List<PubAttach> findList(PubAttach pubAttach) {
		return super.findList(pubAttach);
	}
	
	public Page<PubAttach> findPage(Page<PubAttach> page, PubAttach pubAttach) {
		return super.findPage(page, pubAttach);
	}
	
	@Transactional(readOnly = false)
	public void save(PubAttach pubAttach) {
		super.save(pubAttach);
	}
	
	@Transactional(readOnly = false)
	public void delete(PubAttach pubAttach) {
		super.delete(pubAttach);
	}

	@Transactional(readOnly = false)
	public int updatelike(String id, String userid, String articleid, String type, String arttype, String articlename) {
		// TODO Auto-generated method stub
		return pubAttachDao.updatelike(id,userid,articleid,type,arttype,articlename);
	}

	public PubAttach getlikeflag(String userid, String articleid) {
		// TODO Auto-generated method stub
		return pubAttachDao.getlike(userid,articleid);
	}

	public PubAttach getcolflag(String userid, String articleid) {
		// TODO Auto-generated method stub
		return pubAttachDao.getcol(userid,articleid);
	}

	public List<Object[]> findComment(String articleid) {
		return pubAttachDao.findComment(articleid);
	}

	@Transactional(readOnly = false)
	public int savecomment(String id, String articleid, String userid, String type, String arttype, String comment, String commenttime,String articlename) {
		// TODO Auto-generated method stub
		return pubAttachDao.savecomment(id,articleid,userid,type,arttype,comment,commenttime,articlename);
	}

	public List<Object[]> colList(String userid) {
		// TODO Auto-generated method stub
		return pubAttachDao.colList(userid);
	}
	
}